package com.example.administrator.meishi.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/9/19.
 */
public class MyAdapter extends FragmentPagerAdapter {
    List<String> marray = new ArrayList<>();
    List<Fragment> mlist;

    public MyAdapter(FragmentManager fm, List<Fragment> list, List<String> array) {
        super(fm);
        this.mlist = list;
        this.marray = array;
    }

    @Override
    public Fragment getItem(int position) {
        return mlist.get(position);
    }

    @Override
    public int getCount() {
        return mlist.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return marray.get(position);
    }
}
